/**
*		@file Compare.h
*		@brief Compare class
*
*		@author Lan Ziquan
*
*		@date 1/25/2012
*/
#ifndef COMPARE_H
#define COMPARE_H

#include "VarTable.h"
#include "ProcTable.h"
using namespace std;

class Compare{
public:
	/**
	*		This method will check if var_idx_1 and var_idx_2 have the same name
	*/
	static bool CompareNameVV(VarIdx var_idx_1, VarIdx var_idx_2)
	{ return VarTable::GetVarName(var_idx_1).compare(VarTable::GetVarName(var_idx_2)) == 0; };

	/**
	*		This method will check if proc_idx_1 and proc_idx_2 have the same name
	*/
	static bool CompareNamePP(ProcIdx proc_idx_1, ProcIdx proc_idx_2)
	{ return ProcTable::GetProcName(proc_idx_1).compare(ProcTable::GetProcName(proc_idx_2)) == 0; };

	/**
	*		This method will check if var_idx and proc_idx have the same name
	*/
	static bool CompareNameVP(VarIdx var_idx, ProcIdx proc_idx)
	{ return ProcTable::GetProcName(proc_idx).compare(VarTable::GetVarName(var_idx)) == 0; };

	/**
	*		This method will check if proc_idx and var_idx have the same name
	*/
	static bool CompareNamePV(ProcIdx proc_idx, VarIdx var_idx)
	{ return ProcTable::GetProcName(proc_idx).compare(VarTable::GetVarName(var_idx)) == 0; };

	/**
	*		This method will check if value_1 and value_2 are the same
	*/
	static bool CompareValue(int value_1, int value_2)	// int = StmtNum or const
	{ return value_1 == value_2; };
};

#endif